import CloudFileModel from '../../db/schemas/cloud-file.schema';
import { CloudFileSchemaInterface } from '../../interfaces/db/cloud-file-schema.interface';

class CloudFileService {
  constructor() {}

  public async insert(data) {
    return await CloudFileModel.create(data);
  }

  public async insertMany(data: Array<object>) {
    return await CloudFileModel.insertMany(data);
  }

  public async update(id: string, data: object) {
    return await CloudFileModel.findByIdAndUpdate(id, data);
  }

  public async queryById(id: string) {
    return await CloudFileModel.findById(id);
  }

  public async queryOne(data: object) {
    return await CloudFileModel.findOne(data);
  }

  public async remove(id: string) {
    return await CloudFileModel.findByIdAndRemove(id);
  }

}

export default CloudFileService;
